<div class="row animated" ng-class="{true: 'fadeInRight', false:'fadeInLeft'}[currentAnimated]">
  <div class="col-xs-12 col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
        <a ng-click="discard()" href="javascript:;"><i class="backBtn fa fa-arrow-circle-left"></i></a>
        <span class="panelTitle" ng-bind="Form.title"></span>
      </div>
      <div class="panel-body">
        <form novalidate role="form" name="commentForm" class="form-horizontal">
          <div class="form-group" ng-class="{'has-error': commentForm.content.$invalid && commentForm.content.$dirty}">
            <label class="col-xs-3 col-md-2 control-label">评论内容：</label>
            <div class="col-xs-7 col-md-8">
              <input type="text" name="content" class="form-control" placeholder="评论内容" ng-model="comment.content" required>
            </div>
            <div class="col-xs-2 col-md-2" ng-show="commentForm.content.$dirty && commentForm.content.$invalid">
              <span class="text-danger" ng-show="commentForm.content.$error.required">请输入评论内容</span>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-xs-3 col-md-2">作品图片：</label>
            <div class="col-xs-7 col-md-8">
              <div class="button btn btn-primary fl" ngf-select="upload($files)" multiple="multiple" ngf-pattern="'image/*'"
                ngf-accept="'image/*'" ngf-max-size="10MB">上传图片</div>
              <a href="javascript:void(0)" class="btn btn-info ml15" ng-click="openPhotoLibs()">图片库</a><span class="clearfix"></span>
              <iconlist></iconlist>
            </div>
          </div>
          <div class="form-group" ng-class="{'has-error': commentForm.userName.$invalid && commentForm.userName.$dirty}">
            <label class="col-xs-3 col-md-2 control-label">评论人：</label>
            <div class="col-xs-7 col-md-8">
              <input type="text" name="userName" class="form-control w25c" placeholder="评论人" ng-model="comment.userName" required>
            </div>
          </div>
          <div class="form-group" ng-class="{'has-error': commentForm.score.$invalid && commentForm.score.$dirty}">
            <label class="col-xs-3 col-md-2 control-label">打分：</label>
            <div class="col-xs-7 col-md-8">
              <input type="number" name="score" class="form-control w25c" placeholder="1到5分, 5分为非常满意" ng-model="comment.score" required>
            </div>
          </div>
          <div class="col-xs-offset-2 col-md-offset-2 col-xs-offset-10 col-md-offset-10">
            <button class="btn btn-primary" type="submit" ng-click="submitForm()"  ng-disabled="commentForm.$invalid">保存</button>
            <button class="btn btn-white" ng-click="discard()">取消</button>
          </div>
        </form>
      </div>
    </div>    
  </div>
</div>
<imagepreview></imagepreview>
<upload-task></upload-task>